<template>
  <div class="app-container">
    <NavBar />
    <div class="layout-content">
      <keep-alive v-if="$route.meta.keepAlive">
        <router-view />
      </keep-alive>
      <router-view v-else />
    </div>
    <div class="layout-footer">
      <TabBar :data="tabbars" @change="handleChange" />
    </div>
  </div>
</template>

<script>
import TabBar from '@/components/TabBar'
import NavBar from '@/components/NavBar'
export default {
  name: 'AppLayout',
  data() {
    return {
      tabbars: [
        {
          title: '工作台',
          path: '/work',
          icon: 'work',
          size: 24
        },
        {
          title: '',
          path: '/add',
          icon: 'add',
          size: 48
        },
        {
          title: '列表',
          path: '/list',
          icon: 'list',
          size: 24
        }
      ]
    }
  },
  components: {
    TabBar,
    NavBar
  },
  methods: {
    handleChange(v) {
      console.log('tab value:', v)
    }
  }
}
</script>
